package com.dmatek.uwb.xml.util.iparse.bean;
import com.dmatek.uwb.xml.dom.bean.BasePath;
import com.dmatek.uwb.xml.dom.bean.BranchPath;
import com.dmatek.uwb.xml.dom.bean.MainPath;
import com.dmatek.uwb.xml.util.iassign.IAssignAttributeTool;
/**
 * 路径解析实现类
 * @author zhangfu
 * @data 2019年6月22日 下午3:22:56
 * @Description
 */
public class PathParse extends BaseDomParse<BasePath> {
	public PathParse(IAssignAttributeTool iAssignTool) {
		super(iAssignTool);
	}
	@Override
	public boolean isMatch(String clazzName) throws Exception {
		if(MainPath.DOM_NAME.equalsIgnoreCase(clazzName) 
		|| BranchPath.DOM_NAME.equalsIgnoreCase(clazzName)) {
			return true;
		}
		return false;
	}
	@Override
	protected BasePath createEmpty(String clazzName) {
		if(MainPath.DOM_NAME.equalsIgnoreCase(clazzName)) {
			return new MainPath();
		} else if(BranchPath.DOM_NAME.equalsIgnoreCase(clazzName)) {
			return new BranchPath();
		}
		return null;
	}
}
